var context_qt;
// 初始化
function init_qt()
{
    if (typeof qt != 'undefined')
    {
        new QWebChannel(qt.webChannelTransport, function(channel)
        {
            context_qt = channel.objects.context_qt;  //从通道中获取交互对象
        })
    }
    else
    {
        console.log("qt object obtain fail!");
    }
}
// 向qt发送消息
function sendMessage(msg, para)
{
    if(typeof context_qt == 'undefined')
    {
        console.log("context_qt object obtain fail!");
    }
    else
    {
        context_qt.onRecvMsg(msg, para);  //调用交互对象接口，接收消息
    }
}
// 控件响应函数
function open_notepad(msg, para)
{
    sendMessage(msg, para);
}

init_qt();
